package com.yungu.swift.assets.driver.dao;

import com.yungu.swift.assets.driver.model.dto.CarInsuranceDto;
import com.yungu.swift.base.mapper.IMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * DriverTrainMapper数据库操作接口类
 **/

public interface CarInsuranceMapper extends IMapper<CarInsuranceDto> {
    /**
     * 获取实体
     *
     * @param uuid String
     * @return CarInsuranceDto
     */
    CarInsuranceDto get(String uuid);

    /**
     * 批量新增车辆保险
     *
     * @param carInsuranceDtoList List
     * @return int
     */
    int addBatch(@Param("list") List<CarInsuranceDto> carInsuranceDtoList);

    /**
     * 批量更新车辆保险
     *
     * @param carInsuranceDtoList List
     * @return int
     */
    int updateBatch(List<CarInsuranceDto> carInsuranceDtoList);

    /**
     * 删除
     *
     * @param carUuid String
     * @return int
     */
    @Delete("DELETE FROM t_car_insurance WHERE car_uuid=#{carUuid}")
    int delByCarUuid(@Param("carUuid") String carUuid);
}